home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 61
/
061.d81
/
vcr companion
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
7KB
|
213 lines
90 print "[147]":poke 53280,0:poke 53281,0
100 gosub 4000:goto 3000
290 print "[156][147] building table "
292 print "num ------- name ------ tape.entry"
300 for v=1 to tb :gosub1000:next:return
490 rem --------------------- error chk
500 input#15,e,e$,a,b
510 ife<20ore=73thenreturn
520 ife=50thenreturn
530 print"there is an i/o problem"
540 print"error # is";e;" ";e$
550 print"track";a;"; sector";b
560 close8:close15
570 print"[156]press space to continue[146][145][145]";
580 ifpeek(203)=64then580
590 ifpeek(203)<>60then580
600 clr:goto90
900 rem open command chnl
910 close15:open 15,8,15:gosub490:return
950 rh=int(rn/256):rl=rn-(256*rh):return
1000 gosub900:v$=tb$(v)
1003 print#15,"r0:"+v$+"="+v$:input#15,er
1010 if er<>63 then rn=8: goto 1100
1020 open8,8,8,"0:"+(v$)+",l,"+chr$(40):gosub490
1030 for rn=1to8:gosub950:print#15,"p"+chr$(96+8)+chr$(rl)+chr$(rh)+chr$(1)
1040 gosub490:input#8,aa$,bb$,cc$,dd$,ee$:gosub490
1050 if aa$=chr$(255)then rn=8: goto 1090
1060 if cc$=""then 1090
1070 gosub 1300:rem str in tab
1090 next
1100 close8:close15:fi=1:return
1290 open8,8,8,"0:"+(v$)+",l,"+chr$(ln)
1300 rem in tab
1310 pt=pt+1:n$(pt)=cc$:tg(pt)=pt:tn(pt)=val(v$)*10+rn
1312 print" [145]"
1315 print pt-1 ;"- ";cc$;tab(30);val(v$);rn;"[145]"
1320 gosub 1800:return
1400 rem get directory
1410 close15:open15,8,15,"i0":gosub490:open2,8,2,"#":gosub490:bt=0
1415 print "[146][156][147] getting directory"
1420 t$=chr$(18):s$=chr$(1)
1430 gosub 1600:get#2,t$,s$
1440 fori=1to 8:bp=2+((i-1)*32):gosub1650:a1=0
1450 get#2,a$:ifasc(a$+z$)<>132 then 1520
1460 get#2,a$,a$
1470 get#2,a$:a=asc(a$+z$):if a=160 then 1500
1480 ifa<48ora>57then 1520
1490 a=a-48:a1=a1*10+a:goto1470
1500 if a1<1ora1>200 then 1520
1510 gosub 1700
1520 next:if asc(t$+z$)<>0then1430
1530 close2:close15:return
1600 rem read "u1"
1610 print#15,"u1";2;0;asc(t$+z$);asc(s$+z$):gosub 490
1620 return
1650 rem buff ptr
1660 print#15,"b-p";2;bp:gosub 490
1670 return
1700 a$=str$(a1):l=len(a$):tb=tb+1:if tb>200then 1740
1710 tb$(tb)=mid$(a$,2,(l-1))
1720 print "[146] [145]"
1730 print "[146][158] directory entry ";tb$(tb);"[145]"
1740 return
1800 rem insert in table
1810 lo=1:hi=pt-1:yw=0:ifpt>(2^pw)then pw=pw+1:goto1810
1820 df=int((hi-lo)/2+.5):md=lo+df
1830 if df=0 then 1870
1835 yw=yw+1:ifyw>pwthen 1870
1840 if cc$>n$(tg(md)) then lo=md:goto1820
1850 if cc$=n$(tg(md)) then 1870
1860 hi=md:df=int((hi-lo)/2+.5):md=hi-df:goto 1830
1870 lo=pt:if cc$>n$(tg(md))then md=md+1
1880 tg(lo)=tg(lo-1):lo=lo-1:if lo>md then 1880
1890 tg(md)=pt:return
1900 rem add on end/repl
1910 print "[146][158] build on end of table? (y/n)":tb=0
1920 poke 198,0:wait 198,15:geta$
1930 if a$="n" then print " replacing table!":gosub4100:return
1940 if a$<>"y"then 1920
1950 print " building on the end of table!":return
2000 rem display names
2010 lc=0:i=0
2020 print "[146][147] alphabetic list"
2030 print "num ----- name ------ tape.entry "
2050 lc=lc+1:if lc>15 then gosub2300:gosub2200
2055 i=i+1:s1=2+-1*(i<10)+-1*(i<100)+-1*(i<1000):l=len(n$(tg(i)))
2056 s2=23-l+1*(tn(tg(i))>100)+1*(tn(tg(i))>1000)
2058 if mid$(n$(tg(i)),1,1)=chr$(255)then lc=lc-1:goto2070
2060 print "[159]";i;spc(s1);n$(tg(i));spc(s2);tn(tg(i))/10
2070 if i<(pt-1) then 2050
2080 return
2200 rem clear page
2210 print "":for j=1 to 16:print" "
2220 next:print "":return
2300 rem wait
2310 poke 198,0:wait 198,15:geta$:lc=1:return
2500 rem print names
2510 lc=0:i=0:close4:open4,4:print#4,chr$(0):if st<>0 then 2590
2515 close4:open4,4,0
2520 print#4," alphabetic list"
2530 print#4," num ----- name ------ tape.entry ";chr$(13)
2550 lc=lc+1:if lc>56 then lc=0:forj=1to7:print#4,chr$(0):next:goto2520
2555 i=i+1:s1=2+-1*(i<10)+-1*(i<100)+-1*(i<1000):l=len(n$(tg(i)))
2556 s2=23-l+1*(tn(tg(i))>100)+1*(tn(tg(i))>1000)
2558 if mid$(n$(tg(i)),1,1)=chr$(255)then 2570
2560 print#4," ";i;spc(s1);n$(tg(i));spc(s2);tn(tg(i))/10
2570 if i<(pt-1) then 2550
2580 close4:return
2590 print:print" printer unavailable":return
3000 rem menu
3010 print"":print "[147][213][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][201]";
3020 print "[221] [146]d[146]isplay [146]l[146]oad [146]a[146]dd [221]";
3030 print "[221] [146]p[146]rint [146]save [146]b[146]uild [221]";
3035 print "[221] [146]m[146]ain menu [146]h[146]elp l[146]o[146]adstar [221]";
3040 print "[202][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][195][203]";
3050 poke 198,0:wait 198,15:get a$:
3060 if a$="d" then gosub 2000:goto3200:rem disp
3070 if a$="p" then gosub 2500:goto3200:rem print
3080 if a$="m" then f$="vcr library":n$="main menu":goto4500
3085 if a$="o" then f$="hello connect":n$="loadstar":goto4500
3090 if a$="s" then gosub3300:goto3200:rem save
3100 if a$="a" then gosub3500:goto3200:rem add
3110 if a$="l" then gosub3400:goto3200:rem load
3115 if a$="h" then gosub3800:goto3200:rem load
3120 if a$="b" then gosub1900:gosub1400:gosub290:goto3200:rem build
3150 goto3050
3200 print"[146] any key continues"
3210 poke 198,0:wait 198,15:geta$:goto 3010
3300 rem save file
3310 print "[146] saving file! ":ifpt>1then 3330
3320 print "[158] no file to save[146]":goto3200
3330 close15:open15,8,15,"i0":gosub490:print#15,"s0:999":gosub490
3335 close15:open15,8,15,"i0":gosub490:open3,8,3,"@0:999,s,w":gosub490
3340 for i=1 to pt:if left$(n$(tg(i)),1)=chr$(255) then 3360
3350 print#3,i:print#3,n$(tg(i)):print#3,tn(tg(i)):x=i
3360 next:print#3,x+1:print#3,chr$(255)+chr$(255)+chr$(255):print#3,0
3370 close3:close15:fi=0:return
3400 rem load file
3405 print "[146] loading file! ":pt=0:pw=0
3410 close15:open15,8,15,"i0":gosub490:print#15,"r0:999=999":input#15,er
3420 if er<>63 then 3490
3430 close15:open15,8,15,"i0":gosub490:open3,8,3,"999,s,r":gosub490
3440 pt=pt+1:input#3,tg(pt),n$(pt),tn(pt)
3450 if left$(n$(pt),1)<>chr$(255) then 3440
3460 tg(pt)=pt:n$(pt)=chr$(255)+chr$(255)+chr$(255):tn(pt)=0
3470 close3:close15:fi=1:return
3490 print " [158]no file to load[146]":return
3500 rem add/update
3510 print "[146][147][158] enter add file name":a1=0:a1$=""
3515 print " [213][195][195][195][195][201]"
3516 print " [221] [221]"
3517 print " [202][195][195][195][195][203] [145][145]"
3520 get a$:if a$=""then 3520
3530 a=asc(a$):if a=13 then 3570
3540 if a=20 then 3600
3550 if a<48ora>57then3520
3560 if len(a1$)<3 thena1$=a1$+a$
3562 print " ";a1$;" [145]":goto3520
3570 a=val(a1$):if a<1 or a>200 then 3590
3580 v$=a1$:goto3630
3590 print "[146] invalid file name":return
3600 l=len(a1$):l=l-1:ifl<0then l=0
3610 a1$=mid$(a1$,1,l):goto3562
3630 close15:open15,8,15,"i0":print#15,"r0:"+v$+"="+v$:input#15,er
3640 if er=63 then print"":goto3660
3650 print "[146] [159]file not found":return
3660 i=0:a=val(v$)*10
3670 i=i+1:ifi>pt then 3750
3680 if tn(i)>a and tn(i)<a+10 then 3690
3683 goto 3670
3690 print" [145]":print " deleting: ";n$(i)"[145]"
3695 j=0:n$(i)=chr$(255)+chr$(255)+chr$(255):tn(i)=0
3700 j=j+1:if j>=pt then 3670
3710 if tg(j)<>i then 3700
3720 lo=j
3730 tg(lo)=tg(lo+1):lo=lo+1:iflo<ptthen3730
3740 tg(pt)=i:goto 3700
3750 tb=1:tb$(1)=v$:gosub290:fi=1:close3:close15:return
3800 print "[146][147][159]display: displays current file in table"
3810 print "[159]print: prints current file in table"
3820 print "[159]build: builds an alphabetic table file"
3825 print "from all the individual tape files"
3830 print "[159]save: saves the current table file"
3835 print "